load("//tools:defaults.bzl", "ng_project", "ng_web_test_suite", "ts_project")

package(default_visibility = ["//visibility:public"])

ts_project(
    name = "testing",
    srcs = glob(
        ["**/*.ts"],
        exclude = ["**/*.spec.ts"],
    ),
    deps = [
        "//src/cdk/testing",
        "//src/material/datepicker/testing",
        "//src/material/form-field/testing/control",
        "//src/material/input/testing",
        "//src/material/select/testing",
    ],
)

filegroup(
    name = "source-files",
    srcs = glob(["**/*.ts"]),
)

ng_project(
    name = "unit_tests_lib",
    testonly = True,
    srcs = glob(["**/*.spec.ts"]),
    deps = [
        ":testing",
        "//:node_modules/@angular/core",
        "//:node_modules/@angular/forms",
        "//:node_modules/@angular/platform-browser",
        "//src/cdk/testing",
        "//src/cdk/testing/private",
        "//src/cdk/testing/testbed",
        "//src/material/autocomplete",
        "//src/material/core",
        "//src/material/datepicker",
        "//src/material/datepicker/testing",
        "//src/material/form-field",
        "//src/material/input",
        "//src/material/input/testing",
        "//src/material/select",
        "//src/material/select/testing",
    ],
)

ng_web_test_suite(
    name = "unit_tests",
    deps = [
        ":unit_tests_lib",
    ],
)
